package com.jy.rhin.domain.notification.receive.entity;

import lombok.Data;

import java.util.Date;

/**
 * @author dhl
 * @date 2022/6/28
 * @Description 基础服务消息接收do
 */
@Data
public class ReceiveMessageDO {

    /**
     * 初始化对象
     */
    public ReceiveMessageDO(){
        this.createTime = new Date();
    }

    /**
     * 创建消息接收
     * @param msgId
     * @param content
     * @param publisherCode
     * @param publishTime
     */
    public ReceiveMessageDO receiveMessage(String msgId, Long topicId, String content, String publisherCode, Date publishTime){
        this.topicId = topicId;
        this.msgId = msgId;
        this.content = content;
        this.publisherCode = publisherCode;
        this.publishTime = publishTime;
        return this;
    }

    /**
     * 唯一标识
     */
    private Long id;
    /**
     * 主题表达式
     */
    private Long topicId;
    /**
     * 业务方消息标识id
     */
    private String msgId;
    /**
     * 消息内容
     */
    private String content;
    /**
     * 参与者编码
     */
    private String publisherCode;
    /**
     * 参与者消息发送时间
     */
    private Date publishTime;
    /**
     * 消息创建时间
     */
    private Date createTime;

}
